package com.itrui.feign.client;

import com.itrui.feign.client.pojo.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;

@FeignClient("productservice")
public interface ProductClient {

    @GetMapping("/product/stock/{id}")
    public int getStock(@PathVariable("id") Long productId);

    @PutMapping("/product/stock/{id}")
    public Boolean updateStock(@PathVariable("id") Long productId);

    @GetMapping("/pro/{id}")
    public Product getProductById(@PathVariable("id") Long productId);

}
